package com.gopay.gass.service.impl.bank;

import org.springframework.stereotype.Service;

import com.gopay.common.domain.bank.BcdlMessage;
import com.gopay.gass.constants.SameBank;
import com.gopay.gass.domain.GassMainOrder;
import com.gopay.gass.domain.GassOrderDtl;
import com.gopay.gass.service.impl.GassPayRequestServiceImpl;

/**
 * Created by HJY on 2015/4/3.
 */

@Service("cmbGassPayRequestService")
public class CMBGassPayRequestServiceImpl extends GassPayRequestServiceImpl {

    protected SameBank getSameBank(String recvBankName){
        if(recvBankName.indexOf("招行") !=-1 || recvBankName.indexOf("招商")!=-1){
            return SameBank.NO;
        }
        return SameBank.YES;
    }

	@Override
	protected BcdlMessage buildBcdlMessage(GassMainOrder main, GassOrderDtl dtl) {
		BcdlMessage message = super.createBaseBcdlMessage(main, dtl);
        message.setPbocBankName(getBankName());
        message.setPobcBankCode("308");
		return message;
	}

	@Override
	protected String getBankName() {
		return "招商银行";
	}

}
